package model;

public class Patient {
	private Integer Id = null;
	private int 	version = -1;
	private String	NII;	// National Individual (Health) Id
	private String 	firstName;
	private String 	lastName;
	private String 	notes;

	public Patient() {
	}
	public Patient(Integer Id, int version, String NII, String firstName,
			String lastName, String notes) {
		this.Id = Id;
		this.version = version;
		this.NII = NII;
		this.firstName = firstName;
		this.lastName = lastName;
		this.notes = notes;
	}
	public Patient(String NII, String firstName, String lastName, String notes) {
		this.Id = Id;
		this.version = version;
		this.NII = NII;
		this.firstName = firstName;
		this.lastName = lastName;
		this.notes = notes;
	}
	
	public Integer getId() {
		return Id;
	}
	public void setId(Integer id) {
		Id = id;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public String getNII() {
		return NII;
	}
	public void setNII(String nii) {
		NII = nii;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getNotes() {
		return notes;
	}
	public void setNotes(String notes) {
		this.notes = notes;
	}
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((Id == null) ? 0 : Id.hashCode());
		result = prime * result + ((NII == null) ? 0 : NII.hashCode());
		result = prime * result
				+ ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());
		result = prime * result + ((notes == null) ? 0 : notes.hashCode());
		result = prime * result + version;
		return result;
	}
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Patient other = (Patient) obj;
		if (Id == null) {
			if (other.Id != null)
				return false;
		} else if (!Id.equals(other.Id))
			return false;
		if (NII == null) {
			if (other.NII != null)
				return false;
		} else if (!NII.equals(other.NII))
			return false;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		if (notes == null) {
			if (other.notes != null)
				return false;
		} else if (!notes.equals(other.notes))
			return false;
		if (version != other.version)
			return false;
		return true;
	}
	@Override
	public String toString() {

		return "(" + NII + "," + firstName +
			"," + lastName + "," + notes + ")";
	}

	
}
